<me:UIWS x:Class="WPFExcelReport.TWASTAMM"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"     
                    xmlns:me="clr-namespace:WPFExcelReport" 
                    xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
                    xmlns:ex="clr-namespace:WPFExcelReport.Controls;assembly=ExControls" 
                    xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT" 
                    xmlns:LS="clr-namespace:WPFExcelReport;assembly=TLIEFDAT" 
                    xmlns:IMG="clr-namespace:WPFExcelReport;assembly=TICC_IMAGES" 
                    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
                    xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"  
                    Background="#FFBAD9FE"  
                    x:Name="TV"
                    Loaded="Window_Loaded"
     >
    <me:UIWS.Resources>
        <CollectionViewSource  x:Key="vwMaster"/>       <CollectionViewSource  x:Key="vwDetail"/>
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:NOTConverter  x:Key="not"/>
        <ucd:BoolToVisibilityConverter  x:Key="bv"/>
        <ucd:NOTBoolToVisibilityConverter x:Key="nbv"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIWS.Resources>
    <Grid Name="MainGrid">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"></ColumnDefinition>
            <ColumnDefinition Width="Auto"></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <!--IMG:TICC_IMAGES Grid.Row="0" Grid.RowSpan="3" Grid.Column="1" KEY="{Binding WAART,ElementName=TV}"  PHOTOLINK="{Binding PHOTOLINK,ElementName=TV}"/
      
            <Image  Name="POTO" Grid.Row="0" Grid.RowSpan="3" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Top"  
               Visibility="{Binding IsImage,ElementName=TV,Converter={StaticResource bv}}"
               Source="{Binding Path=PHOTOLINK, ElementName=TV}" 
               Stretch="None" 
               MouseRightButtonUp="Image_MouseRightButtonUp" 
        ImageSource="{Binding Path=PHOTOLINK, ElementName=TV}" 
               />
          <Button Grid.Row="0" Grid.RowSpan="3" Grid.Column="1" >
            <Button.Background>
                <ImageBrush  ImageSource="/ImagePackage;component/Images/Chart.png" Stretch="None"/>
            </Button.Background>
        </Button>
        -->
        <Image  Name="cImage" Grid.Row="0" Grid.RowSpan="2" Grid.Column="1"  Width="200" Height="200" VerticalAlignment="Center"
               Visibility="{Binding IsImage,ElementName=TV,Converter={StaticResource bv}}" HorizontalAlignment="Center"
               Source="{Binding Path=PHOTOLINK, ElementName=TV}" 
               Stretch="UniformToFill" 
               MouseRightButtonUp="Image_MouseRightButtonUp" 
               MouseLeftButtonDown="Image_MouseLeftButtonUp"
        
               /> 
        <StackPanel Grid.Row="0" Grid.Column="0"  Name="ZoneMaster">            
            <WrapPanel Margin="0,5,0,0">
                <Grid  Margin="0,0,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Row="0"  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=幅宽:}}"></TextBlock>
                    <ex:NumericBox  Grid.Row="0" Grid.Column="1"  
                                    IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  TabIndex="500" 
                                    Text="{Binding FBRTU,Converter={StaticResource ResourceKey=d10},ElementName=TV}" MinWidth="40" Width="Auto" />
                    <TextBlock Grid.Row="0"  Grid.Column="2" Text="{Binding Source={Localization:Translate Word=CM}}"></TextBlock>
                    <TextBlock Margin="0,5,0,0"  Grid.Row="1" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=可用幅宽:}}"></TextBlock>
                    <ex:NumericBox Margin="0,5,0,0"  Grid.Row="1" Grid.Column="1" Text="{Binding FBRTL,Converter={StaticResource ResourceKey=d10},ElementName=TV}" 
                                    IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"  TabIndex="501"   MinWidth="40" Width="Auto" />
                    <TextBlock Margin="0,5,0,0" Grid.Row="1"  Grid.Column="2" Text="{Binding Source={Localization:Translate Word=CM}}"></TextBlock>
                </Grid>
                <Grid  Margin="10,0,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock  Grid.Row="0" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=克重:}}"></TextBlock>
                  
                    <TextBox  Grid.Row="0" Grid.Column="1"   Width="60"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" TabIndex="502"   >
                        <TextBox.Text>
                            <Binding Path="FGRLFD" ElementName="TV">
                                <Binding.ValidationRules>
                                    <ucd:NumberRangeRule Min="1" Max="999" />
                                </Binding.ValidationRules>
                            </Binding>
                        </TextBox.Text>
                    </TextBox>
                    <TextBlock Grid.Row="0"  Grid.Column="2" Text="{Binding Source={Localization:Translate Word=g/m}}"></TextBlock>
                    <TextBlock  Grid.Row="1"  Grid.Column="0" Margin="0,5,0,0" Text="{Binding Source={Localization:Translate Word=克重:}}"></TextBlock> 

                    <TextBox  Grid.Row="1" Grid.Column="1"   Width="60"  IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" TabIndex="502"   >
                        <TextBox.Text>
                            <Binding Path="FGRQM" ElementName="TV">
                                <Binding.ValidationRules>
                                    <ucd:NumberRangeRule Min="1" Max="999" />
                                </Binding.ValidationRules>
                            </Binding>
                        </TextBox.Text>
                    </TextBox>
                    <TextBlock Grid.Row="1"  Grid.Column="2" Margin="0,5,0,0" Text="{Binding Source={Localization:Translate Word=g/sqm}}"></TextBlock>
                </Grid>
                <Grid  Margin="10,0,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock   Grid.Row="0"  Grid.Column="0" Text="{Binding Source={Localization:Translate Word=经密:}}" ></TextBlock>
                    <ex:NumericBox  Grid.Row="0"  Grid.Column="1" 
                                    IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}"
                                    VerticalAlignment="Top" TabIndex="503" 
                                    Text="{Binding FFDDIK,Converter={StaticResource ResourceKey=d100},ElementName=TV}"  MinWidth="40" Width="Auto" />
                    <TextBlock   Grid.Row="0" Grid.Column="2"   
                                 Text="{Binding DENUM,ElementName=TV}"  Width="Auto" />
                    <TextBlock  Grid.Row="1"  Grid.Column="0" Margin="0,5,0,0" Text="{Binding Source={Localization:Translate Word=纬密:}}"></TextBlock>
                    <ex:NumericBox Grid.Row="1"  Grid.Column="1"  Margin="0,5,0,0"
                                   IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                                   TabIndex="504"  Text="{Binding FFDDIS,Converter={StaticResource ResourceKey=d100},ElementName=TV}"  MinWidth="40" Width="Auto" />
                    <TextBlock Text="{Binding DENUM,ElementName=TV}"  Grid.Row="1"  Grid.Column="2"
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"/>
                    <SD:TSSD0181  Margin="0,5,0,0" Grid.Row="1" Grid.Column="2" Name="c181"   
                                  KEY="{Binding DENUM,ElementName=TV}" 
                                 Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                                  IsEdit="{Binding IsEdit,ElementName=TV}" />
                </Grid>
            </WrapPanel>
            <StackPanel Visibility="{Binding IsExtProd,ElementName=TV,Converter={StaticResource bv}}">
                <WrapPanel Margin="0,5,0,0" >
                    <Grid  Visibility="Collapsed">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Margin="5,0,0,0"  Grid.Column="0" Text="{Binding Source={Localization:Translate Word= 供应商品种/色号:}}"></TextBlock>
                        <TextBlock  Margin="5,0,0,0"   Grid.Column="1"  
                                   Text="{Binding WALOHNA}"  
                                   MinWidth="40" Width="Auto" />
                    </Grid>
                    <WrapPanel>
                        
                        <TextBlock  Margin="0,0,0,0" Grid.Column="0" Text= "采购信息:"/>
                        <TextBlock Margin="5,0,0,0"   Grid.Column="1"  Text="{Binding WABIND}"
                                   Visibility="{Binding IsEdit, ElementName=TV, Converter={StaticResource nbv}}"/>
                        <WrapPanel  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"> 
                            <ex:NumericBox   Margin="5,0,0,0" MaxLength="8"  Grid.Column="0" DecimalPlaces="2"
                                       Text="{Binding WSPRICE,ElementName=TV}"                                     
                                       FontSize="18"   Width="60" />
                            <TextBlock Text="{Binding CURRENCY,ElementName=TV}"
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"/>
                            <SD:TSSD0149 Grid.Column="1"
                                     KEY="{Binding CURRENCY,ElementName=TV}" 
                                      Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                                     IsEdit="{Binding IsEdit,ElementName=TV}" />
                            <TextBlock Text="{Binding PRMEEH,ElementName=TV}"
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"/>
                            <SD:TSSD0181 Grid.Column="2" 
                                     KEY="{Binding PRMEEH,ElementName=TV}" 
                                      Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                                     IsEdit="{Binding IsEdit,ElementName=TV}" />
                        </WrapPanel>
                    </WrapPanel>

                    <Grid  Margin="5,0,0,0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"></RowDefinition>
                            <RowDefinition Height="Auto"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Row="0" Grid.Column="0" Text="{Binding Source={Localization:Translate Word=起订量:}}"></TextBlock>
                        <ex:NumericBox Grid.Row="0" Grid.Column="1" Text="{Binding WAFMINPMENG}" 
                               IsReadOnly="{Binding IsEdit,ElementName=TV,Converter={StaticResource not}}" 
                                   TabIndex="505"  MinWidth="40" Width="Auto" VerticalAlignment="Top" />
                        <TextBlock Text="{Binding WAUEBM,ElementName=TV}" Grid.Row="0" Grid.Column="2"
                           Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource nbv}}"/>
                        <SD:TSSD0181  Grid.Row="0" Grid.Column="3" MinWidth="50" 
                                  KEY="{Binding WAUEBM,ElementName=TV}" 
                                  Visibility="{Binding IsEdit,ElementName=TV,Converter={StaticResource bv}}"
                                  IsEdit="{Binding IsEdit,ElementName=TV}" />
                    </Grid>
                </WrapPanel>
                <WrapPanel Margin="0,5,0,0">
                    <Grid >
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Grid.Column="0" Text= "我方佣金:"/>
                        <ex:NumericBox Margin="10,0,0,0"   Grid.Column="1" DecimalPlaces="1"
                                       Text="{Binding WAKBON,Converter={StaticResource d100}}" 
                                       Width="50" />
                        <TextBlock  Margin="5,0,0,0" Grid.Column="2" Text= "%"/>
                    </Grid>
                    <Grid Margin="0,5,0,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                            <ColumnDefinition Width="Auto"></ColumnDefinition>
                        </Grid.ColumnDefinitions>
                        <TextBlock  Margin="5,0,0,0" Grid.Column="0" Text= "供应商:"/>
                        <TextBlock Margin="5,0,0,0"   Grid.Column="1"  
                                   Text="{Binding LSLIEFNA,ElementName=TV, Converter={StaticResource gb2312}}" 
                                   Width="Auto" />
                        <CheckBox Grid.Column="2" 
                                  IsChecked="{Binding IsShowRight,ElementName=TV}"/>
                    </Grid>
                    <LS:TSLS02 KEY="{Binding WALIEFNR,ElementName=TV}"  
                               ORDERNUM="{Binding WALIEFNR,ElementName=TV}" 
                                LSLIEFNA="{Binding LSLIEFNA,ElementName=TV}"  
                                QTYP="{Binding WAKBON,ElementName=TV}"  
                               IsEdit="{Binding IsEdit,ElementName=TV}" />
                </WrapPanel>
            </StackPanel>
        </StackPanel> 
    </Grid>
</me:UIWS>
